<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>一百以内奇数的和</title>
</head>
<body>
    <script>
        var i=0,sum=0;
        while(i<=100){
            if(i%2==1)
                sum+=i;
            i++;
        }
        alert(sum);
    </script>
</body>
</html>